const app = require('./app');
const sequelize = require('./config/database');

const PORT = process.env.PORT || 3000;

// 使用安全的数据库同步选项，不自动更新表结构
sequelize.sync({ force: false, alter: false })
  .then(() => {
    console.log('Database synced successfully');
    app.listen(PORT, () => {
      console.log(`Server is running on port ${PORT}`);
    });
  })
  .catch(err => {
    console.error('Unable to sync database:', err);
  }); 